package com.xl.basic.entity;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 用于获取配置和环境变量
 *
 * @author 钟勇
 * Create in 2023/8/23 16:02
 */
@Data
@Component
@ConfigurationProperties(prefix = "properties")
public class Properties {

    private Basic basic = new Basic();
    private File file = new File();
    private Auth auth = new Auth();
    private WxMp wxMp = new WxMp();
    private WxPay wxPay = new WxPay();

    @Data
    public static class Basic {
        private String domain = "http://bak.cndoer.com";
    }

    //文件上传配置
    @Data
    public static class File {
        private String visitPath = "/upload";
        private String linuxPath = "/home/upload";
        private String windowPath = "C://upload";
    }

    //鉴权相关配置
    @Data
    public static class Auth {
        private String tokenPrefix = "Bearer ";
        private String tokenSecret = "rX8$1ug*!BDa";
        private Long tokenExpire = (long) 60 * 60 * 24;
        private String passwordSalt = "A6vZEgfF^bF@";
        private String sessionName = "userInfo";
        private String defaultPassword = "pwdComm@0000";
    }

    //微信相关配置
    @Data
    public static class WxMp {
        private String appId = "wxb63341c608274cee";
        private String appSecret = "b93a44110e36c1129aed0d440c90a0b4";
        private String token = "etfoOlombotkwtZmmOJqfTGCWWlo9jot";
        private String aesKey = "Iq9YQnvF96IQnVQ669qQaVNp77n9Ai99iN61ZnAN9Qn";
    }

    @Data
    public static class WxPay {
        private String appId = "wxb63341c608274cee";
        private String mchId = "1639482583";
        private String mchKey = "3UYPfc4TVUfJscBeusN7FJqaf7DzwWSP";
        private String keyPath = "classpath:cert/apiclient_cert.p12";
    }
}
